
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/main.css">
    <link rel="stylesheet" href="../css/jquery-ui.css">
    <link href="../css/bootstrap.css" rel="stylesheet" type="text/css" />
    <title>Title</title>
</head>
<body>
<form  id='File2Form' method="post" action="" enctype="multipart/form-data" style="display: inline-block">
    <input type="text" name="UserNumber" style="display: none;" value="<?php echo $_GET['UserNumber']; ?>">
    <input  type="file" name="UserFile"  style="display: inline-block;border:0; padding:0; margin:0; "/>
    <input class="ext_btn add  mt10" type="button"  value="上传" style="display: inline-block" onclick="return checkFile(this.form)" />
</form>
</body>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/config.js"></script>
<script>
    function checkFile(e) {
//        alert(e.UserFile.value);
        var UserFile=e.UserFile.value.split('.');
        var UserName=UserFile[UserFile.length-1];
        UserName=UserName.toLowerCase();
        if(e.UserFile.value!=''){
            if(UserName=='jpg'||UserName=='jpeg'||UserName=='png')
                        e.submit();
            else{
                alert("格式不正确！ 只能上传:jpg、jpeg、png格式");
            }
        }else{
            alert("请选择上传图片！");
        }
        return false;
    }
    $(function () {
        $("#File2Form").attr('action',url+"admin/User/UserSignFile.php");
    })
</script>
</html>